<?php
// +----------------------------------------------------------------------
// | 零云 [ 简单 高效 卓越 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://www.lingyun.net All rights reserved.
// +----------------------------------------------------------------------
// | Author: jry <598821125@qq.com>
// +----------------------------------------------------------------------
namespace Home\Controller;

/**
 * 上传控制器
 * @author jry <598821125@qq.com>
 */
class MobileauthController extends HomeController
{
    public function sendAuth($mobile) {
        send_sms($mobile,1);
    }

    public function sendSuccess($mobile) {
        send_sms($mobile,2);
    }

    public function smscron() {
        $post_object = D('Admin/Inviteorder');
        $begintime = strtotime(date("Y-m-d 00:00:00",time()));
        $endtime = strtotime(date("Y-m-d 23:59:59",time()));
        $con['jointime'] = array('between',array($begintime,$endtime));
        $con['status'] = 1;
        $con['ispay'] = 1;

        $datalist = $post_object->where($con)->select();
        $issend = array();
        foreach ($datalist as $val) {
            if (!in_array($val['mobile'],$issend)) {
                send_sms($val['mobile'],3,$val['inviteid'],1);
                $issend[] = $val['mobile'];
            }
        }
    }
}
